package top.taooc.example.consumer;

import top.taooc.example.common.model.User;
import top.taooc.example.common.service.UserService;
import top.taooc.proxy.ServiceProxyFactory;

/**
 * @author songtao@guishangyi.cn
 * @date 2024年07月04日 16:09:37
 * @packageName top.taooc.example.consumer
 * @className ConsumerExample
 * @Menu
 */
public class ConsumerExample {
    public static void main(String[] args) {
        //获取代理
        UserService userService = ServiceProxyFactory.getProxy(UserService.class);
        User user = new User();
        user.setName("taooc");
        //调用
        User newUser = userService.getUser(user);
        if (newUser != null) {
            System.out.println(newUser.getName());
        } else {
            System.out.println("user == null");
        }
//        short number = userService.getNumber();
//        System.out.println(number);
    }
}
